{% extends "base.html" %}
{% block title %}Standings{% endblock %}
{% block content %}
<link href="{{static_pathname}}/css/stat.css" rel="stylesheet" type="text/css" />
<div id="container">


  <!-- this whole template assumes that we are given a table of (game, team, division, league) and that they ARE SORTED BY league then division  -->


  {% for league_list in records %}
  <div class="league">
    <fieldset style="width:90%;">
<legend> <span class="league-title">{{league_list.league}}</span></legend>
    {% for division_list in league_list.divisions %}
        <br/>
        <span class="division-title">Division {{ forloop.counter }}</span>
        <table>
        <tr><th>Team</th><th>Wins</th><th>Losses</th></tr>
        {% autoescape off %}
          {% for team_list in division_list.teams %}
          <tr><td>{{team_list.teamRanking.Team}}</td><td>{{team_list.teamRanking.wins}}</td><td>{{team_list.teamRanking.losses}}</td></tr>
          {% endfor %}
        {% endautoescape %}
        </table>
        <br/>
    {% endfor %}
    </fieldset> <br/>
    </div>
  {% endfor %}
</div>
{% endblock %}
